package com.wn.access.api;

import com.wn.common.model.dto.bank.BankCardAddDTO;
import com.wn.common.model.dto.trade.bid.BankBidDTO;
import com.wn.common.model.dto.trade.bid.BidBalanceDTO;
import com.wn.common.model.dto.trade.bid.BorrowRecordStatusDTO;
import com.wn.common.model.vo.bank.SignatureVo;
import com.wn.common.model.vo.borrow.BorrowRecordVo;
import com.wn.common.model.vo.pay.RepayVo;
import com.wn.common.model.vo.trade.bid.LoanVo;
import com.wn.common.result.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author yellow Docter
 * @date 2023 -03-01
 * @desc
 */
@FeignClient("sddfp-bank-access-service")
public interface BankAccessApi {

    @PostMapping("/bank/access/card")
    public Result<SignatureVo> addBankAccount(@RequestBody BankCardAddDTO bankCardAddDTO);

    @ApiOperation(value = "托管代理向银行托管系统同步借款数据")
    @PostMapping("/bank/access/snyc/borrow")
    Result<String> syncBorrowRecord(@RequestBody BorrowRecordVo borrowRecordVo);


    @ApiOperation("获取机构账户余额信息")
    @GetMapping("/bank/access/bid/balance/{userCode}")
    Result<BidBalanceDTO> getBidBalance(@PathVariable("userCode") String userCode);

    @ApiOperation("银行保存投标记录")
    @PostMapping("/bank/access/bid/add")
    Result<String> bankBidService(@RequestBody BankBidDTO bankBidDTO);

    @ApiOperation(value = "审核借款项目放款")
    @PostMapping("/bank/access/confirm-loan")
    Result<String> confirmLoan(@RequestBody LoanVo loanVo);

    @ApiOperation(value = "修改借款项目状态") // 放款：接口3，修借款的状态
    @ApiImplicitParam(value = "修改借款项目状态",paramType = "body")
    @PostMapping("/bank/access/borrowRecord/status")
    Result<String> updateBorrowRecordStatus(
            @RequestBody BorrowRecordStatusDTO borrowRecordStatusDTO);

    @ApiOperation(value = "确认还款")
    @PostMapping("/bank/access/confirm/repay")
    Result<String> confirmRepay(
            @RequestBody RepayVo repayVo);
}
